package com.xuecheng.manage_course.controller;


import com.xuecheng.framework.model.response.ResponseResult;
import com.xuecheng.manage_course.entity.CoursePic;
import com.xuecheng.manage_course.service.impl.CoursePicServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author testjava
 * @since 2020-12-31
 */
@RestController
@RequestMapping("/manage_course/course-pic")
public class CoursePicController {

    @Autowired
    CoursePicServiceImpl coursePicService;


    public ResponseResult addCoursePic(String courseId, String pic) {
        return null;
    }


    @PreAuthorize("hasAuthority('course_find_pic')")
    @GetMapping("/findCoursePic/{courseId}")
    public CoursePic findCoursePic(@PathVariable("courseId") String courseId) {
        return coursePicService.findCoursePic(courseId);
    }


    @DeleteMapping("/deleteCoursePic/{courseId}")
    public ResponseResult deleteCoursePic(@PathVariable("courseId") String courseId) {
        return coursePicService.deleteCoursePic(courseId);
    }

}

